"use strict";
{
    //1. 类的声明
    class Person {
        //方法
        //构造方法
        constructor(name, age) {
            this.alias = "张三";
            this.name = name;
            this.age = age;
        }
        //方法
        run() {
            console.log("我可以奔跑~~");
        }
        //calculate
        calc(a, b) {
            return a + b;
        }
    }
    //实例化对象
    // let me: Person  = new Person("xiaohigh", 18);
    //输出
    // console.log(me);
    // me.run();
    // console.log(me.calc(100, 200));
    //2. 类的继承
    class Programmer extends Person {
        constructor(name, age, language) {
            super(name, age); //super 指向的父类的构造方法  Person.call(this, name, age)
            this.language = language;
        }
        intro() {
            console.log(`我叫 ${this.name} , 今年 ${this.age} 岁, 擅长的语言是 ${this.language}`);
        }
        run() {
            console.log("我可以跑的很快~~~");
        }
    }
    //实例化对象
    // let zhe = new Programmer('哲', 18, "JavaScript");
    // zhe.intro();
    // zhe.run();
    //3. 类的成员修饰符
    class Girl {
        constructor(name, age, weight) {
            this.name = name;
            this.age = age;
            this.weight = weight;
        }
        intro() {
            console.log(this.name, this.age, this.weight); //√
        }
    }
    class Child extends Girl {
        //声明一个方法
        access() {
            // access 进入 访问
            console.log(this.name); //√
            console.log(this.age); // √
            // console.log(this.weight); //x
        }
    }
    //实例化对象
    let wbb = new Girl("王冰冰", 28, 97);
    let goudan = new Child('狗蛋', 8, 25);
    goudan.access();
    // console.log(wbb.name);  //√
    // console.log(wbb.age);    // x
    // console.log(wbb.weight); //x
    // wbb.intro();
}
